<?php
session_start();
if (isset($_SESSION["username"])) {
?>
  <?php require_once('common/header.php'); ?>
  <!--页面主要内容-->
  <main class="lyear-layout-content">
    <div class="container-fluid">
      <?php
      include_once("../untils/conn.php");
      $channel_id = $_GET['channel_id'];
      $data = mysqli_query($con, "select * from channel where channel_id=" . $channel_id);
      $rows = mysqli_fetch_row($data);
      ?>

      <div class="card">
        <div class="card-header bg-primary">
          <h4>渠道修改</h4>
        </div>
        <div class="card-body">
          <form action="controller/upChannel.php" method="POST">
              <div class="input-group m-b-10">
                <label class="input-group-addon" for="channel_name" id="basic-addon1">渠道名称</label>
                <input type="text" class="form-control" name="channel_name" placeholder="请输入渠道名称"value="<?php echo $rows[1] ?>" required>
              </div>
             
              <div class="input-group m-b-10">
                <span class="input-group-addon" for="channel_type" id="basic-addon1">渠道类型</span>
                <select class="form-control" name="channel_type">
                  <option value="0">线上渠道</option>
                  <option value="1">线下渠道</option>
                </select>
              </div>
              
               <div class="input-group m-b-10">
                <span class="input-group-addon" for="channel_leader" id="basic-addon1">渠道负责人</span>
                <input type="text" class="form-control" name="channel_leader" placeholder="请输入渠道负责人" value="<?php echo $rows[3] ?>" required>
              </div>
              
               <div class="input-group m-b-10">
                <span class="input-group-addon" for="channel_phone" id="basic-addon1">负责人号码</span>
                <input type="text" class="form-control" name="channel_phone" placeholder="请输入负责人号码" value="<?php echo $rows[4] ?>" required>
              </div>
              
              <!--<div class="input-group m-b-10">-->
              <!--  <span class="input-group-addon" for="channel_type" id="basic-addon1">时间戳</span>-->
                <input type="hidden" class="form-control" name="channel_id" value=<?php echo $channel_id ?> required>
              <!--</div>-->
              
              <div class="form-row mt-3">
                <div class="offset-2">
                  <button class="btn btn-success" type="submit" value="修改">立即修改</button>
                 
                </div>
              </div>
            </form>
        </div>
      </div>
    </div>
  </main>
  <!--End 页面主要内容-->
  <?php require_once('common/footer.php'); ?>
<?php
} else {
  echo "<script>alert('您尚未登录，没有权限访问该页面');location.href='login.php';</script>";
}
?>